<!DOCTYPE html>
<html lang="en">

<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>barrage server API 调试</title>
    <style>
        h1 {
            text-align: center;
        }
    </style>
</head>

<body>
    <h1>barrage server API 调试</h1>
    <!--
        <a href="Launcher.IE://www.baidu.com">强制IE打开</a>
    -->
    <div class="barrage-btn">
        <a href="javascript:void(0)" id="send">发送弹幕</a>
        <a href="javascript:void(0)" id="query">查询弹幕</a>
    </div>
    <script type="text/javascript" charset="utf-8" src="http://apps.bdimg.com/libs/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="https://cdn.bootcss.com/socket.io/1.4.5/socket.io.min.js"></script>

    <script type="text/javascript" charset="utf-8" src="../src/js/Barrage.js"></script>
    <script type="text/javascript" charset="utf-8">
        $(function () {

            $('#send').on('click', sendBarrage);
            $('#query').on('click', queryBarrage);
            var testTime = 15,
                curId = undefined,
                videoName = 'videoTest',
                id = 1000,
                demandUrl = 'http://192.168.1.206:3000',
                liveUrl = 'http://192.168.1.206:3001',
                isLive = 0;

            var barrage = new Barrage(false); // false / true -  点播 / 直播

            barrage.connectServer(demandUrl, videoName, id);

            /* 发送弹幕 */
            function sendBarrage() {
                console.log(barrage.id);
                barrage.SendMsgToServer(testTime, '您好', '#ffffff', 14, curId);
            }

            /* 查询弹幕 */
            function queryBarrage() {
                barrage.getMessageByTime(testTime);
            }

        });
    </script>
</body>

</html>